import {INCREMENT} from "./mutilation-types";

export default {
  //定义方法
  [INCREMENT](state) {
    state.counter++
  },
  decrement(state) {
    state.counter--
  },
  incrementCount(state, count) {
    state.counter += count
  },
  addStudent(state, stu) {
    state.students.push(stu)
  },
  updateInfo(state) {
    state.info.name = 'ymx'
    //不能在这里进行异步操作
    // setTimeout(() => {
    //   state.info.name = 'ymx'
    // }, 1000)

    //state.info['address] = '天津'

    // Vue.set(state.info, 'address', '天津')
    //delete state.info.age
    // Vue.delete(state.info, 'age')
  }
}
